using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._EditingTools._Conflation
{
    /// <summary>
    /// <para>Transfer Attributes</para>
    /// <para>Finds where the source line features spatially match the target line features and transfers specified attributes from source features to matched target features.</para>
    /// <para>查找源线要素在空间上与目标线要素匹配的位置，并将指定属性从源要素传输到匹配的目标要素。</para>
    /// </summary>    
    [DisplayName("Transfer Attributes")]
    public class TransferAttributes : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public TransferAttributes()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_source_features">
        /// <para>Source Features</para>
        /// <para>Line features from which to transfer attributes.</para>
        /// <para>要从中传输属性的线要素。</para>
        /// </param>
        /// <param name="_target_features">
        /// <para>Target Features</para>
        /// <para>Line features to which to transfer attributes. The specified transfer fields are added to the target features.</para>
        /// <para>要将属性传输到的线要素。指定的传输字段将添加到目标要素中。</para>
        /// </param>
        /// <param name="_transfer_fields">
        /// <para>Transfer Field(s)</para>
        /// <para>List of source fields to be transferred to target features. At least one field must be specified.</para>
        /// <para>要传输到目标要素的源字段列表。必须至少指定一个字段。</para>
        /// </param>
        /// <param name="_search_distance">
        /// <para>Search Distance</para>
        /// <para>The distance used to search for match candidates. A distance must be specified and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.</para>
        /// <para>用于搜索匹配候选项的距离。必须指定距离，并且该距离必须大于零。您可以选择首选单位;默认值为要素单位。</para>
        /// </param>
        public TransferAttributes(object _source_features, object _target_features, List<object> _transfer_fields, string? _search_distance)
        {
            this._source_features = _source_features;
            this._target_features = _target_features;
            this._transfer_fields = _transfer_fields;
            this._search_distance = _search_distance;
        }
        public override string ToolboxName => "Editing Tools";

        public override string ToolName => "Transfer Attributes";

        public override string CallName => "edit.TransferAttributes";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_source_features, _target_features, _transfer_fields, _search_distance, _match_fields, _out_match_table, _out_feature_class, _transfer_rule_fields];

        /// <summary>
        /// <para>Source Features</para>
        /// <para>Line features from which to transfer attributes.</para>
        /// <para>要从中传输属性的线要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Source Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _source_features { get; set; }


        /// <summary>
        /// <para>Target Features</para>
        /// <para>Line features to which to transfer attributes. The specified transfer fields are added to the target features.</para>
        /// <para>要将属性传输到的线要素。指定的传输字段将添加到目标要素中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _target_features { get; set; }


        /// <summary>
        /// <para>Transfer Field(s)</para>
        /// <para>List of source fields to be transferred to target features. At least one field must be specified.</para>
        /// <para>要传输到目标要素的源字段列表。必须至少指定一个字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Transfer Field(s)")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _transfer_fields { get; set; }


        /// <summary>
        /// <para>Search Distance</para>
        /// <para>The distance used to search for match candidates. A distance must be specified and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.</para>
        /// <para>用于搜索匹配候选项的距离。必须指定距离，并且该距离必须大于零。您可以选择首选单位;默认值为要素单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Distance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _search_distance { get; set; }


        /// <summary>
        /// <para>Match Fields</para>
        /// <para>Lists of fields from source and target features. If specified, each pair of fields are checked for match candidates to help determine the right match.</para>
        /// <para>源要素和目标要素中的字段列表。如果指定，则会检查每对字段的匹配候选项，以帮助确定正确的匹配项。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Match Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _match_fields { get; set; } = null;


        /// <summary>
        /// <para>Output Match Table</para>
        /// <para>The output table containing complete feature matching information.</para>
        /// <para>包含完整要素匹配信息的输出表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Match Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_match_table { get; set; } = null;


        /// <summary>
        /// <para>Updated Target Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Target Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Transfer Rule Field(s)</para>
        /// <para><xdoc>
        ///   <para>Sets rules to control which source feature will be used to transfer attributes from when multiple source features matched target feature(s). The source feature to be used for the transfer is determined by the specified rule fields and the ruling values, which are ranked from high to low priority as they appear in the specified list. If no rules are set, the longest of the multiple matched source features will be used for the transfer.</para>
        ///   <para>Available rule types are as follows:</para>
        ///   <bulletList>
        ///     <bullet_item>MIN—The minimum value for integer or date field. If for a date field, the most recent date.</bullet_item><para/>
        ///     <bullet_item>MAX—The maximum value for integer or date field. If for a date field, the oldest date.</bullet_item><para/>
        ///     <bullet_item>A text or integer value that may exist in your source features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>设置规则以控制当多个源要素与目标要素匹配时，将使用哪个源要素从中传输属性。用于传输的源要素由指定的规则字段和判定值确定，这些值在指定列表中显示时按从高到低的优先级排序。如果未设置任何规则，则将使用多个匹配源要素中最长的一个进行传输。</para>
        ///   <para>可用的规则类型如下：</para>
        ///   <bulletList>
        ///     <bullet_item>MIN - 整数或日期字段的最小值。如果是日期字段，则为最近的日期。</bullet_item><para/>
        ///     <bullet_item>MAX - 整数或日期字段的最大值。如果是日期字段，则为最早的日期。</bullet_item><para/>
        ///     <bullet_item>源要素中可能存在的文本或整数值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Transfer Rule Field(s)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _transfer_rule_fields { get; set; } = null;


        public TransferAttributes SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}